<template>
	<div>
		<el-tabs v-model="activeName" @tab-click="handleClick">
			<el-tab-pane label="业务管理" name="first" key="first">
				<!--				<businessType></businessType>-->
				<billingRule ref="billingRule"></billingRule>
			</el-tab-pane>
			<el-tab-pane label="价格表设置" name="second" key="second">
				<priceListSsetting ref="priceListSsetting"></priceListSsetting>
			</el-tab-pane>
			<el-tab-pane label="提成设置" name="third" key="third">
				<royaltySetting ref="royaltySetting"></royaltySetting>
			</el-tab-pane>
			<el-tab-pane label="派单设置" name="fourth" key="fourth">
				<orderSetting ref="orderSetting"></orderSetting>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
import businessType from './businessType/businessType'
import billingRule from './businessType/billingRule'
import priceListSsetting from './priceListSsetting/priceListSsetting'
import royaltySetting from './royaltySetting/royaltySetting'
import orderSetting from './orderSetting'

export default {
	name: 'index',
	components: {businessType, billingRule, priceListSsetting, royaltySetting, orderSetting},
	data () {
		return {
			activeName: 'first',
		}
	},
	mounted () {
		this.$nextTick(()=>{
			this.$refs.billingRule.common()
			this.$refs.billingRule.getList()
		})
	},
	methods: {
		handleClick(e){
			switch (e.name){
                 case 'first':
                 	this.$refs.billingRule.common()
                 	this.$refs.billingRule.getList()
                 	break;
                 case 'second':
					 this.$refs.priceListSsetting.common()
					 this.$refs.priceListSsetting.getList()
                 	break;
                 case 'third':
					 this.$refs.royaltySetting.getList()
                 	break;
                 case 'fourth':
					 this.$refs.orderSetting.getData()
                 	break;
			}
		}

	}
}
</script>


